<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>启动图管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- 确保适当的绘制和触屏缩放 -->
    <link rel="stylesheet" href="{$url_css}bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="{$url_css}admin.css" type="text/css">
    <script type="text/javascript" src="{$url_js}jquery-1.12.0.min.js"></script>
</head>
<body>

<div class="container" style="width:96%">
    <table class="table table-bordered table-striped" align="center">
        <tr>
            <td><a href="?do=Add" class="btn btn-primary">添加启动图</a></td>
        </tr>
    </table>
    <table class="table table-bordered table-striped table-hover" align="center">
        <thead>
            <tr>
                <td colspan="10">启动图列表</td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>ID</td>
                <td>启动图对应应用名</td>
                <td>启动图名称</td>
                <td>启动图点击URL</td>
                <td>启动图描述</td>
                <td>开始时间</td>
                <td>结束时间</td>
                <td>预览</td>
                <td>状态</td>
                <td>操作</td>
            </tr>

            {if !empty($data)}
                {foreach $data as $item}
                    <tr>
                        <td>{$item.Id}</td>
                        <td>{$app_ids[$item.AppId]['AppName']|html}</td>
                        <td>{$item.Name|html}</td>
                        <td>{$item.Url|html}</td>
                        <td>{$item.Description|html}</td>
                        <td>{$item.StartTime|html}</td>
                        <td>{$item.EndTime|html}</td>
                        <td>
                            <a href="{$item.ImgUrl}" target="_blank"><img src="{$item.ImgUrl}" width="100px" alt=""/></a>
                        </td>
                        <td>
                            {if $item.StartStatus == 1}
                                <span class="label label-primary">未开始</span>
                            {elseif $item.StartStatus == 2}
                                <span class="label label-success">进行中</span>
                            {else}
                                <span class="label label-danger">已结束</span>
                            {/if}
                        </td>
                        <td><a href="?do=delete&id={$item.Id}&app_id={$item.AppId}" class="btn btn-danger delete delete_btn">删除</a></td>
                    </tr>
                {/foreach}
            {/if}

            {if !empty($pagination)}
                <tr>
                    <td colspan="8">{$pagination}</td>
                </tr>
            {/if}
        </tbody>
    </table>
</div>

{literal}
<script>
    //删除
    $(".delete_btn").click(function(){
        var url = self.location.pathname + $(this).attr("href");
        top.__confirm('确定要删除吗？','删除后不可恢复！', url, self);
        return false;
    });
</script>
{/literal}
</body>
<html>